#include <stdio.h>
#include "ofc/DCircle.h"
#include "ofc/DInt.h"

int main(int argc, char *argv[])
{
  DCircle *fifo = [DCircle alloc];
  DCircle *lifo = [DCircle new  ];
  DInt    *val;

  [fifo init :20];                     // Init with size 20

  val = [DInt new]; [val set :1];
  [fifo enqueue :val];                 // Enqueue value 1 in lifo

  val = [DInt new]; [val set :2];      // Enqueue value 2 in lifo
  [fifo enqueue :val];

  val = [fifo dequeue];
  printf("First value in fifo:%d\n", (val != nil ? [val get] : -1));

  [lifo size :20];                     // Insure size in lifo

  val = [DInt new]; [val set :3];
  [lifo push :val];                    // Push value 3 in lifo

  val = [DInt new]; [val set :4];      // Push value 4 in lifo
  [lifo push :val];

  printf("Lifo length:%ld\n", [lifo length]);

  val = [lifo tos];
  printf("TOS in lifo:%d\n", (val != nil ? [val get] : -1));

  [fifo free];                         // Cleanup incl. stored objects
  [lifo free];

  return 0;
}

